package com.itsu.app.service;

import com.itsu.interfaces.entity.Album;
import com.itsu.interfaces.service.AlbumService;
import org.apache.dubbo.config.annotation.Reference;
import org.bson.types.ObjectId;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AppAlbumService {

    @Reference
    AlbumService albumService;

    void saveAlbum(ObjectId publishId, Long uid) {
        Album album = new Album();
        album.setId(new ObjectId());
        album.setPublishId(publishId);
        album.setCreated(System.currentTimeMillis());
        albumService.saveAlbum(album, uid);
    }

    public List<Album> findAlbums(Long userId) {
        return albumService.findAlbums(userId);
    }
}
